
/* 

REPLICATION CODE FOR: 
Venkataramani A.S. and Chatterjee P. "Early Medicaid Expansion and Drug Overdose Mortality in the USA: A Quasi-Experimental Analysis"
Published in the Journal of General Internal Medicine (JGIM)

VERSION: 9/5/2018

NOTES:
This file uses data state-year data on on age-adjusted, drug overdose mortality rates 
(ICD 10: X40-X44, X60-X64, X85, Y10-Y14) from 1999-2008 for 25-64 year-olds from the 
U.S. Centers for Disease Control (https://wonder.cdc.gov/mortSQL.html) and socioeconomic data from
the University of Kentucky Center for Poverty Research, UKCPR; http://www.ukcpr.org/data). See published paper for further details.
The data file provided is our cleaned data extract. Researchers should be able to use the above links to and information to download
the source files. 

*/

global filepath "[YOUR FILE PATH HERE]"

use "$filepath/medicaid_opiates_JGIM_database.dta", clear


/* FIGURE 1 */
*User to adjust appearance 

*A
lgraph ageadj year exp_st if year>=1999&year<=2008 [aw = pop], 

*B
lgraph ageadj year neighbor_st if year>=1999&year<=2008 [aw = pop], 


/* TABLE 1 */
xi: reghdfe ageadj expansion unemp_rate pov_rate if year>=1999&year<=2008 [aw = pop], abs(statefips year)  cluster(statefips)
xi: reghdfe ageadj expansion unemp_rate pov_rate welf_fs_4p_benefit ssi_total state_min_wage if year>=1999&year<=2008 [aw = pop], abs(statefips year statefips#c.year)  cluster(statefips)
xi: reghdfe ageadj expansion unemp_rate pov_rate  if year>=1999&year<=2008&neighbor_st~=. [aw = pop], abs(statefips year)  cluster(statefips)

